#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
    
    int arr[10];
    int i = 0;
    for (i = 0; i < 10; i++)
    {
        scanf("%d", &arr[i]);
    }

    int max = arr[0];
    int j = 0;
    for (j = 0; j < 10; j++)
    {
        if (max < arr[j])
            max = arr[j];
    }

    int min = arr[0];
    int t = 0;
    for (t = 0; t < 10; t++)
    {
        if (min > arr[t])
            min = arr[t];
    }

    printf("%d %d", max, min);
    return 0;
}